// TestPlugin.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include <windows.h>
#include <malloc.h>

#include "..\PluginSetup\PluginDecl.h"

void LogWrite(LPSTR lpstrMessage)
{
	OutputDebugString(lpstrMessage);
	OutputDebugString("\n");
}

typedef struct
{
	int iValue;
	void* pValue;
} MyDataStruct;

extern "C" {
	void __declspec(dllexport) DllPluginFunction(int ordinal, PluginData *app)
	{
		//TODO: Send message to the app here
		LogWrite("Test plugin was called.");
		
		MyDataStruct dataStruct;
		dataStruct.iValue = 0;
		dataStruct.pValue = NULL;

		PluginData pluginData;
		pluginData.iValue = sizeof(MyDataStruct);
		pluginData.pValue = &dataStruct;
		
		AppMessage(app, &pluginData);
	}

	BOOL WINAPI DllMain(
		HINSTANCE hInstDll,
		DWORD dwReason,
		LPVOID lpvReserved)
	{
		return TRUE;
	}
};